<?php


/**
 * Presenter pro vykreslovani obsahu verejnych stranek.
 *
 * @author David Dusek
 */

class PageFrontPresenter extends BasePresenter
{
    public function actionDefault() {
//       \Nette\Diagnostics\Debugger::dump($this->getParameter("url"));
       $homepage = FALSE;
       
       $address = $this->getParameter("url");       
       if ($address === null || $address == '/') {
           $homepage = TRUE;
       }
       
       $pageInfo = $this->core->runHook("hookGetPageInfo", array($address, $homepage), "PageModule");
       if ($pageInfo === FALSE) {
           throw new BadRequestException();
       }
       
       $this->template->pageInfo = $pageInfo;
       
       $this->setLayout($pageInfo["layout"]);
    }
}
